package Userjava.Userdao;

import org.springframework.stereotype.Component;
import java.sql.SQLException;
/**
 * 转账底层实现
 * */
@Component
public class bankDaoImpl  {
    public int jianMoney(String name,int money) throws SQLException {
        String sql="UPDATE `ren`.`bank` SET  `currentMoney` =`currentMoney`-? WHERE `customerName` =?";
       return DButil.executeUpdate(sql,new Object[]{money,name});
    }
    public int jiaMoney(String name,int money) throws SQLException {
        String sql="UPDATE `ren`.`bank` SET  `currentMoney` =`currentMoney`+? WHERE `customerName` =?";
        return DButil.executeUpdate(sql,new Object[]{money,name});
    }

}
